package com.sgxy.service.impl;

import com.sgxy.entity.EmployeeInf;
import com.sgxy.mapper.EmployeeInfMapper;
import com.sgxy.service.EmployeeInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeInfServiceImpl implements EmployeeInfService {

    private final EmployeeInfMapper employeeInfMapper;
    @Autowired
    public EmployeeInfServiceImpl(EmployeeInfMapper employeeInfMapper) {
        this.employeeInfMapper = employeeInfMapper;
    }

    @Override
    public int addEmployeeInf(EmployeeInf employeeInf) {
        int i = employeeInfMapper.insertEmployeeInf(employeeInf);
        return i;
    }

    @Override
    public int deleteEmployeeInf(List<String> ids){
        int i = employeeInfMapper.deleteEmployeeInfById(ids);
        return i;
    }

    @Override
    public int updateEmployeeInf(EmployeeInf employeeInf) {
        int i = employeeInfMapper.updateByPrimaryKeySelective(employeeInf);
        return i;
    }

//    @Override
//    public EmployeeInf queryEmployeeInf(Integer id) {
//        EmployeeInf employeeInf = employeeInfMapper.selectByPrimaryKey(id);
//        return employeeInf;
//    }

    @Override
    public List<EmployeeInf> queryAllEmployeeInfs(EmployeeInf employeeInf) {
        List<EmployeeInf> employeeInfs = employeeInfMapper.queryAllEmployeeInfs(employeeInf);
        return employeeInfs;
    }

    @Override
    public EmployeeInf queryEmployeeInfByid(Integer id) {
        EmployeeInf employeeInf = employeeInfMapper.selectByPrimaryKey(id);
        return employeeInf;
    }
}
